<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/common/css/Hui-iconfont/1.0.7/iconfont.css"/>
    <link href="__PUBLIC__/admin/css/plugins/jsTree/style.min.css" rel="stylesheet">
    <style>
        .Validform_checktip{padding-top:5px;display: inline-block;color:red;}
        .spiner-example{padding:0;}/*border:1px solid #CCC;*/
        .spiner-example img{width:100%;height:100%;}
        .balance{font-weight:bolder;color:red;font-size:18px;}

        .jstree-open > .jstree-anchor > .fa-folder:before {content: "\f07c";}
        .jstree-default .jstree-icon.none {width: 0;}

        #tree{width:100%;height:530px;margin-top:10px;border:none;}
        .pull-right{font-size:18px;border:1px solid #CCC;padding:0px 5px;}
        #nestable2{margin-top:40px;}
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>基本面板 <small class="m-l-sm">MT4账号 ： {$msg.user_id}</small></h5>
                    </div>
                    <div class="ibox-content">
                        <div class="ibox-content">
                            <form role="form" class="form-inline">
                                <div class="form-group">
                                    <label for="exampleInputEmail2" class="sr-only">MT4 账号</label>
                                    <input type="text" placeholder="MT4 账号" name="id" value="{$msg.user_id}" id="exampleInputEmail2" class="form-control" required="" aria-required="true">
                                </div>
                                <button class="btn btn-white" style="margin-top:5px;" type="submit">搜索</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">个人资料</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">MT4设置</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">入金/取款</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">结构图</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">上线一览</a></li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="panel-body">
                                <!--个人资料-->
                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="tabs-container panel panel-info">
                                            <ul class="nav nav-tabs">
                                                <li class="active"><a data-toggle="tab" href="#tab-a1" aria-expanded="true">个人资料</a></li>
                                                <li class=""><a data-toggle="tab" href="#tab-a2" aria-expanded="false">文档</a></li>
                                                <li class=""><a data-toggle="tab" href="#tab-a3" aria-expanded="false">CRM密码</a></li>
                                            </ul>
                                            <div class="tab-content">
                                                <!--资料修改-->
                                                <div id="tab-a1" class="tab-pane active">
                                                    <div class="panel-body">
                                                        <div class="ibox float-e-margins">
                                                            <div class="ibox-title">
                                                                <h5>个人资料-修改</h5>
                                                            </div>
                                                            <div class="ibox-content">
                                                                <form class="form-horizontal m-t" id="commentForm" action="__URL__/updateUserInfo" method="post">
                                                                    <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">状态：</label>
                                                                        <div class="col-sm-8">
                                                                            <select class="form-control m-b" name="user_state">
                                                                                <option value="1" <if condition="$msg.user_state eq 1">selected</if>>启用</option>
                                                                                <option value="2" <if condition="$msg.user_state eq 2">selected</if>>禁用</option>
                                                                            </select>
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">职位：</label>
                                                                        <div class="col-sm-8">
                                                                            <select class="form-control m-b" name="position">
                                                                                <volist name="position" id="vo">
                                                                                    <option value="{$vo.id}" <if condition="$msg['position'] eq $vo['id']">selected</if>>{$vo.user_position}</option>
                                                                                </volist>
                                                                            </select>
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">注册日期：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_createtime" disabled name="user_createtime" type="text" class="form-control" value="{$msg.user_createtime}" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">姓名(英文)：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_name" name="user_name" value="{$msg.user_name}" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">姓名(中文)：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="name_zh_cn" name="name_zh_cn" value="{$msg.name_zh_cn}" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">代理人：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_recommend" name="user_recommend" value="{$msg.user_recommend}" type="text" class="form-control" datatype="n" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">微信：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="weixin" name="weixin" minlength="2" value="{$msg.weixin}" type="text" class="form-control">
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">城市：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="city" name="city" minlength="2" value="{$msg.city}" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">省份：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="province" type="text" value="{$msg.province}" class="form-control" name="province" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">国家：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="country" type="text" disabled value="{$msg.country}" class="form-control" name="country" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">地址：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_address" name="user_address" value="{$msg.user_address}" minlength="2" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">邮编：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="zipcode" name="zipcode" value="{$msg.zipcode}" minlength="2" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">电话：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_phone" name="user_phone" value="{$msg.user_phone}" minlength="2" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">邮箱：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_email" name="user_email" disabled value="{$msg.user_email}" minlength="2" type="text" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">QQ：</label>
                                                                        <div class="col-sm-8">
                                                                            <input name="user_qq" value="{$msg.user_qq}" minlength="2" type="text" class="form-control">
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">性别：</label>
                                                                        <div class="col-sm-8">
                                                                            <div class="radio i-checks">
                                                                                <label><input type="radio" <if condition="$msg.sex eq 1">checked</if> value="1" name="sex"><i></i>男 </label>
                                                                                <label><input type="radio" <if condition="$msg.sex eq 2">checked</if> value="2" name="sex"> <i></i> 女</label>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">证件号：</label>
                                                                        <div class="col-sm-8">
                                                                            <select class="form-control m-b" name="card_type" style="width:18%;display:inline-block;">
                                                                                <option value="1" <if condition="$msg.card_type eq 1">selected</if>>中国身份证</option>
                                                                                <option value="2" <if condition="$msg.card_type eq 2">selected</if>>香港身份证</option>
                                                                                <option value="3" <if condition="$msg.card_type eq 3">selected</if>>台湾身份证</option>
                                                                                <option value="4" <if condition="$msg.card_type eq 4">selected</if>>护照</option>
                                                                            </select>
                                                                            <input style="width:81.5%;display:inline-block" type="text" value="{$msg.user_cards}" class="form-control" name="user_cards" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                                        </div>
                                                                        <i class="Validform_checktip Hui-iconfont">*</i>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-3 control-label">生日：</label>
                                                                        <div class="col-sm-8">
                                                                            <input id="user_birthday" disabled type="text" value="{$msg.user_birthday}" class="form-control laydate-icon form-control layer-date" name="user_birthday">
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <div class="col-sm-4 col-sm-offset-3">
                                                                            <button class="btn btn-primary" id="btn-primary" type="submit">提交</button>
                                                                        </div>
                                                                    </div>
                                                                </form>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!--文档审核-->
                                                <div id="tab-a2" class="tab-pane">
                                                    <div style="margin-top:10px;">当前状态：
                                                        <if condition="$msg.status eq 1"><button type="button" class="btn btn-warning btn-outline ">未认证</button>
                                                            <elseif condition="$msg.status eq 2"/><button type="button" class="btn btn-info btn-outline ">已申请</button>
                                                            <elseif condition="$msg.status eq 3"/><button type="button" class="btn btn-success btn-outline ">批准</button>
                                                            <else/><button type="button" class="btn btn-danger btn-outline ">拒绝</button>
                                                        </if>
                                                    </div>
                                                    <div class="panel-body">
                                                        <div class="col-sm-4">
                                                            <div class="ibox ">
                                                                <div class="ibox-title">
                                                                    <h5>身份证件（正面）</h5>
                                                                </div>
                                                                <div class="ibox-content">
                                                                    <div class="spiner-example">
                                                                        <img src="__ROOT__/{$msg.hand_img}"/>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-sm-4">
                                                            <div class="ibox ">
                                                                <div class="ibox-title">
                                                                    <h5>身份证(背面)</h5>
                                                                </div>
                                                                <div class="ibox-content">
                                                                    <div class="spiner-example">
                                                                        <img src="__ROOT__/{$msg.behind_img}"/>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-sm-4">
                                                            <div class="ibox ">
                                                                <div class="ibox-title">
                                                                    <h5>银行卡(正面)</h5>
                                                                </div>
                                                                <div class="ibox-content">
                                                                    <div class="spiner-example">
                                                                        <img src="__ROOT__/{$msg.front_img}"/>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div style="height:50px;text-align: center;">
                                                        <button type="button" class="btn btn-w-m btn-waming" <if condition="$msg.status eq 1">disabled</if> onclick="examine(1)">未认证</button>&nbsp;&nbsp;
                                                        <button type="button" class="btn btn-w-m btn-info" <if condition="$msg.status eq 2">disabled</if> onclick="examine(2)">已申请</button>&nbsp;&nbsp;
                                                        <button type="button" class="btn btn-w-m btn-success" <if condition="$msg.status eq 3">disabled</if> onclick="examine(3)">批准</button>&nbsp;&nbsp;
                                                        <button type="button" class="btn btn-w-m btn-danger" <if condition="$msg.status eq 4">disabled</if> onclick="examine(4)">拒绝</button>
                                                    </div>
                                                </div>
                                                <!--CRM密码-->
                                                <div id="tab-a3" class="tab-pane">
                                                    <div class="panel-body">
                                                        <form class="form-horizontal" id="newPwd" action="__URL__/updatePwd" method="post">
                                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">新密码：</label>
                                                                <div class="col-sm-8">
                                                                    <input type="password" placeholder="新密码" name="pwd" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" "/>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">确认密码：</label>
                                                                <div class="col-sm-8">
                                                                    <input type="password" placeholder="确认密码" name="repwd" class="form-control" datatype="*" recheck="pwd" nullmsg="null" errormsg="&#xe706;" sucmsg=" "/>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <div class="col-sm-offset-3 col-sm-8">
                                                                    <button class="btn btn-sm btn-info" id="updatePwd" type="submit">修 改</button>
                                                                </div>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--MT4设置-->
                        <div id="tab-2" class="tab-pane">
                            <div class="panel-body">
                                <!--MT4设置-->
                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="tabs-container panel panel-info">
                                            <ul class="nav nav-tabs">
                                                <li class="active"><a data-toggle="tab" href="#tab-b1" aria-expanded="true">MT4资料</a></li>
                                                <li class=""><a data-toggle="tab" href="#tab-b2" aria-expanded="false">组别</a></li>
                                                <li class=""><a data-toggle="tab" href="#tab-b3" aria-expanded="false">杠杆</a></li>
                                                <li class=""><a data-toggle="tab" href="#tab-b4" aria-expanded="false">MT4密码</a></li>
                                            </ul>
                                            <div class="tab-content">
                                                <!--MT4资料修改-->
                                                <div id="tab-b1" class="tab-pane active">
                                                    <div class="panel-body">
                                                        <form class="form-horizontal" id="mt4Data" action="__URL__/updateMt4Data" method="post">
                                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">账户类型：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="group_type" disabled>
                                                                        <if condition="$group_type eq 2">
                                                                            <option value="2" >外汇交易</option>
                                                                        <else/>
                                                                            <option value="1" >短期交易</option>
                                                                        </if>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">允许修改密码：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="enable_change_pass">
                                                                        <option value="1" <if condition="$mt4_msg.enableChangePassword eq 1">selected</if>>允许</option>
                                                                        <option value="0" <if condition="$mt4_msg.enableChangePassword eq 0">selected</if>>不允许</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">MT4 状态：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="enable">
                                                                        <option value="1" <if condition="$mt4_msg.enable eq 1">selected</if>>活跃</option>
                                                                        <option value="0" <if condition="$mt4_msg.enable eq 0">selected</if>>不活跃</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">交易只读：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="enable_readonly">
                                                                        <option value="1" <if condition="$mt4_msg.tradingblocked eq 1">selected</if>>是</option>
                                                                        <option value="0" <if condition="$mt4_msg.tradingblocked eq 0">selected</if>>否</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">发送报告：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="send_reports">
                                                                        <option value="1" <if condition="$mt4_msg.send_reports eq 1">selected</if>>是</option>
                                                                        <option value="0" <if condition="$mt4_msg.send_reports eq 0">selected</if>>否</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <div class="col-sm-offset-3 col-sm-8">
                                                                    <button class="btn btn-sm btn-info" id="updateMt4Data" type="submit">修 改</button>
                                                                </div>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                                <!--组别-->
                                                <div id="tab-b2" class="tab-pane">
                                                    <div class="panel-body">
                                                        <form class="form-horizontal" id="group" action="__URL__/updateGroup" method="post">
                                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">组别：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="group">
                                                                        <volist name="group" id="va">
                                                                            <option value="{$va.mt4_group}" <if condition="$msg['group'] eq $va['mt4_group']">selected</if>>{$va.mt4_group}</option>
                                                                        </volist>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">节点（组别）：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="node">
                                                                        <option value="1">仅自己</option>
                                                                        <option value="2">直属下线</option>
                                                                        <option value="3">所有下线</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <div class="col-sm-offset-3 col-sm-8">
                                                                    <button class="btn btn-sm btn-info" id="updateGroup" type="submit">修 改</button>
                                                                </div>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                                <!--杠杆-->
                                                <div id="tab-b3" class="tab-pane">
                                                    <div class="panel-body">
                                                        <form class="form-horizontal" id="leverage" action="__URL__/updateLeverage" method="post">
                                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">杠杆：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="leverage">
                                                                        <option value="1" <if condition="$msg.level eq 1">selected</if>>1:1</option>
                                                                        <option value="10" <if condition="$msg.level eq 10">selected</if>>1:10</option>
                                                                        <option value="50" <if condition="$msg.level eq 50">selected</if>>1:50</option>
                                                                        <option value="100" <if condition="$msg.level eq 100">selected</if>>1:100</option>
                                                                        <option value="200" <if condition="$msg.level eq 200">selected</if>>1:200</option>
                                                                        <option value="300" <if condition="$msg.level eq 300">selected</if>>1:300</option>
                                                                        <option value="400" <if condition="$msg.level eq 400">selected</if>>1:400</option>
                                                                        <option value="500" <if condition="$msg.level eq 500">selected</if>>1:500</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">节点（杠杆）：</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="node">
                                                                        <option value="1">仅自己</option>
                                                                        <option value="2">直属下线</option>
                                                                        <option value="3">所有下线</option>
                                                                    </select>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <div class="col-sm-offset-3 col-sm-8">
                                                                    <button class="btn btn-sm btn-info" id="updateLeverage" type="submit">修 改</button>
                                                                </div>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                                <!--MT4密码-->
                                                <div id="tab-b4" class="tab-pane">
                                                    <div class="panel-body">
                                                        <form class="form-horizontal" id="mt4Pwd" action="__URL__/updateMt4Pwd" method="post">
                                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">MT4 密码：</label>
                                                                <div class="col-sm-8">
                                                                    <input type="password" placeholder="MT4 密码" name="mt4_pwd" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" "/>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label">投资密码：</label>
                                                                <div class="col-sm-8">
                                                                    <input type="password" placeholder="投资密码" name="investor" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" "/>
                                                                </div>
                                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                                            </div>
                                                            <div class="form-group">
                                                                <div class="col-sm-offset-3 col-sm-8">
                                                                    <button class="btn btn-sm btn-info" id="updateMt4Pwd" type="submit">修 改</button>
                                                                </div>
                                                            </div>
                                                        </form>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--入金取款-->
                        <div id="tab-3" class="tab-pane">
                            <div class="panel-body">
                                <div class="ibox-content text-center">
                                    账户余额 ： $ <span class="balance">{$mt4_msg.balance}</span> &nbsp;&nbsp;&nbsp;&nbsp;<a class="fa fa-refresh" onclick="getBalance('{$msg.user_id}')"></a>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <!--预计可提现 ： <span class="balance_air">{$rate}</span> 元 人民币&nbsp;&nbsp;&nbsp;&nbsp;-->
                                    冻结资金 ： $ <span class="balance_frozen">{$msg.frozen_balance}</span> <!--个 宇航币-->
                                </div>
                                <!--入金取款-->
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>入金</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <form class="form-horizontal" id="deposit" action="__URL__/updateBalance" method="post">
                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                            <input type="hidden" name="type" value="1"/>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">入金金额：</label>
                                                <div class="col-sm-8">
                                                    <input type="number" step="0.01" placeholder="入金金额" class="form-control" name="money" datatype="/^[0-9]+(.[0-9]{0,2})?$/" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">注释：</label>
                                                <div class="col-sm-8">
                                                    <input type="text" placeholder="注释" class="form-control" name="comment" value="deposit#" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-3 col-sm-8">
                                                    <button class="btn btn-sm btn-info" id="btn-deposit" type="submit">入 金</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <!--取款-->
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>取款 <span style="color:red;">提示：取款金额必须为负数</span></h5>
                                    </div>
                                    <div class="ibox-content">
                                        <form class="form-horizontal" id="withdrawal" action="__URL__/updateBalance" method="post">
                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                            <input type="hidden" name="type" value="2"/>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">取款金额：</label>
                                                <div class="col-sm-8">
                                                    <input type="number" step="0.01" placeholder="取款金额" name="money" class="form-control" datatype="/^-\d+(.[0-9]{0,2})?$/" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">注释：</label>
                                                <div class="col-sm-8">
                                                    <input type="text" step="0.01" placeholder="注释" name="comment" class="form-control" value="withdrawal#" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-3 col-sm-8">
                                                    <button class="btn btn-sm btn-info" id="btn-withdrawal" type="submit">取 款</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <!--冻结-->
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>冻结/解冻 <span style="color:red;">提示：冻结金额必须为负数、解冻金额为正数</span></h5>
                                    </div>
                                    <div class="ibox-content">
                                        <form class="form-horizontal" id="frozen" action="__URL__/updateBalance" method="post">
                                            <input type="hidden" name="id" value="{$msg.user_id}"/>
                                            <input type="hidden" name="type" value="3"/>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">冻结金额：</label>
                                                <div class="col-sm-8">
                                                    <input type="number" step="0.01" placeholder="金额" name="money" class="form-control" datatype="/^(\-|\+)?\d+(.[0-9]{0,2})?$/" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">操作类型：</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control m-b setType" name="setType">
                                                        <option value="1">冻结</option>
                                                        <option value="2">解冻</option>
                                                    </select>
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">注释：</label>
                                                <div class="col-sm-8">
                                                    <input type="text" step="0.01" placeholder="注释" name="comment" class="form-control frozen-comment" value="withdrawal#frozen" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                                </div>
                                                <i class="Validform_checktip Hui-iconfont">*</i>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-3 col-sm-8">
                                                    <button class="btn btn-sm btn-info" id="btn-frozen" type="submit">冻 结</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--结构图-->
                        <div id="tab-4" class="tab-pane">
                            <div class="panel-body">
                                <a href="__URL__/downloadTree/id/{$msg.user_id}"><button type="button" class="btn btn-outline btn-info" style="float:right;margin-right:20px;">下载结构图</button></a>
                                <!--结构图-->
                                <!--<div id="jstree1">{$tree}</div>-->
                                <!--结构图2-->
                                <!--<iframe id="tree" name="tree" src="__URL__/getTree/id/{$msg.user_id}"></iframe>-->
                                <!--结构图3-->
                                <div class="dd" id="nestable2">
                                    <ol class="dd-list">
                                        <li class="dd-item" data-id="1">
                                            <div class="dd-handle">
                                                <span class="pull-right" onclick="getTree(this,'{$msg.user_id}',0)" flag="1"> + </span>
                                                <span class="label label-info"><i class="fa fa-users"></i></span> MT4 : {$msg.user_id} Position : {$msg.user_position} Class : 0
                                            </div>
                                        </li>
                                    </ol>
                                </div>
                            </div>
                        </div>
                        <!--上线一览-->
                        <div id="tab-5" class="tab-pane">
                            <div class="panel-body">
                                <!--上线一览-->
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>最近的职位数据</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <table class="table">
                                            <thead>
                                                <tr>
                                                    <th>职位</th>
                                                    <th>MT4</th>
                                                    <th>姓名</th>
                                                    <th>组别</th>
                                                    <th>代理人</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <volist name="position" id="v">
                                                <tr>
                                                    <th>最近的 {$v.user_position}</th>
                                                    <td>{$v.child.user_id}</td>
                                                    <td>{$v.child.user_name}</td>
                                                    <td>{$v.child.group}</td>
                                                    <td>{$v.child.user_recommend}</td>
                                                </tr>
                                            </volist>
                                            <tr>
                                                <th>最高上线（{$maxSuperior.user_position}）</th>
                                                <td>{$maxSuperior.user_id}</td>
                                                <td>{$maxSuperior.user_name}</td>
                                                <td>{$maxSuperior.group}</td>
                                                <td>{$maxSuperior.user_recommend}</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>上线一览</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <table class="table">
                                            <thead>
                                            <tr>
                                                <th>MT4</th>
                                                <th>姓名</th>
                                                <th>职位</th>
                                                <th>组别</th>
                                                <th>代理人</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <volist name="superior" id="vb">
                                                <tr>
                                                    <td>{$vb.user_id}</td>
                                                    <td>{$vb.user_name}</td>
                                                    <th>{$vb.user_position}</th>
                                                    <td>{$vb.group}</td>
                                                    <td>{$vb.user_recommend}</td>
                                                </tr>
                                            </volist>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="Index/common_js"/>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
    <!-- iCheck -->
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
    <!-- jsTree plugin javascript -->
    <script src="__PUBLIC__/admin/js/plugins/jsTree/jstree.min.js"></script>
    <script>
        $(document).ready(function () {
            laydate({
                elem: '#user_birthday', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
                event: 'focus' /*响应事件。如果没有传入event，则按照默认的click*/
            });

            $('#jstree1').jstree({
                'core': {
                    'check_callback': true
                },
                'plugins': ['types', 'dnd'],
                'types': {
                    'default': {
                        'icon': 'fa fa-user-plus'
                    },
                    'html': {
                        'icon': 'fa fa-user'
                    },
                    'svg': {
                        'icon': 'fa fa-file-picture-o'
                    },
                    'css': {
                        'icon': 'fa fa-file-code-o'
                    },
                    'img': {
                        'icon': 'fa fa-file-image-o'
                    },
                    'js': {
                        'icon': 'fa fa-file-text-o'
                    }

                }
            });
        });
        var index;
        $("#commentForm").Validform({
            btnSubmit:"#btn-primary",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
             index = layer.load();
             },callback:function(data){
                 layer.close(index);
                 //alert(JSON.stringify(data));return;
                 //console.log(data);
                 if(data.status==1){
                     layer.msg(data.msg,{icon: 1, time: 2000});
                     location.reload();
                 }else if(data.status==0){
                     layer.msg(data.msg,{icon: 2, time: 2000});
                 }else{
                     layer.msg('网络错误',{icon: 2, time: 2000});
                 }
             }
        });

        $("#newPwd").Validform({/*重置密码*/
            btnSubmit:"#updatePwd",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#mt4Data").Validform({/*修改MT4设置*/
            btnSubmit:"#updateMt4Data",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#group").Validform({/*修改MT4组别杠杆*/
            btnSubmit:"#updateGroup",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#leverage").Validform({/*修改MT4组别杠杆*/
            btnSubmit:"#updateLeverage",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#mt4Pwd").Validform({/*修改MT4密码*/
            btnSubmit:"#updateMt4Pwd",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#deposit").Validform({/*入金*/
            btnSubmit:"#btn-deposit",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    $('.balance').text(data.balance);
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        $("#withdrawal").Validform({/*取款*/
            btnSubmit:"#btn-withdrawal",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    $('.balance').text(data.balance);
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });
		
		$('.setType').change(function (){
            var type=$(this).val();
            if(type==1){
                $('.frozen-comment').val('withdrawal#frozen');
                $('#btn-frozen').text('冻 结');
            }else{
                $('.frozen-comment').val('deposit#frozen');
                $('#btn-frozen').text('解 冻');
            }
        });

        $("#frozen").Validform({/*冻结*/
            btnSubmit:"#btn-frozen",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    $('.balance').text(data.balance);
                    $('.balance_frozen').text(data.frozen_balance);
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });

        function examine(type){/*文档审核：直接传入相应状态即可*/
            if(type==4){
                index=layer.prompt({title: '驳回原因', formType: 2}, function(text, index){
                    layer.close(index);
                    index = layer.load();
                    $.ajax({
                        type:"POST",
                        url:"__URL__/examine",
                        dataType:'json',
                        data:{id:'{$msg.user_id}',type:type,reason:text},
                        success:function(data){
//                        console.log(data);
                            //alert(JSON.stringify(data));return;
                            layer.close(index);
                            if(data.status==1){
                                layer.msg(data.msg,{icon: 1, time: 2000});
                                location.reload();
                            }else{
                                layer.msg(data.msg,{icon: 2, time: 2000});
                            }
                        },error:function(err){
//                            console.log(err);
                            layer.close(index);
                            layer.msg('网络错误',{icon: 2, time: 2000});
                        }
                    });
                });
            }else{
                index = layer.load();
                $.ajax({
                    type:"POST",
                    url:"__URL__/examine",
                    dataType:'json',
                    data:{id:'{$msg.user_id}',type:type},
                    success:function(data){
//                        console.log(data);
                        //alert(JSON.stringify(data));return;
                        layer.close(index);
                        if(data.status==1){
                            layer.msg(data.msg,{icon: 1, time: 2000});
                            location.reload();
                        }else{
                            layer.msg(data.msg,{icon: 2, time: 2000});
                        }
                    },error:function(err){
//                        console.log(err);
                        layer.close(index);
                        layer.msg('网络错误',{icon: 2, time: 2000});
                    }
                });
            }
        }

        function getBalance(id) {/*获取账户余额*/
            index = layer.load();
            $.ajax({
                type:"POST",
                url:"__URL__/getBalance",
                dataType:'json',
                data:{id:id},
                success:function(data){
                    //console.log(data);
                    //alert(JSON.stringify(data));return;
                    layer.close(index);
                    if(data.status==1){
                        $('.balance').text(data.msg.balance);
                        $('.balance_air').text(data.msg.balanceAir);
                    }else{
                        layer.msg(data.msg,{icon: 2, time: 2000});
                    }
                },error:function(err){
//                    console.log(err);
                    layer.close(index);
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            });
        }

        function getTree(obj,id,clas){/*点击获取结构图,在用户量多的时候使用*/
            if($(obj).attr('flag')==1){
                index = layer.load();
                $.ajax({
                    type:"POST",
                    url:"__URL__/getTree2",
                    dataType:'json',
                    data:{id:id},
                    success:function(data){
//                        console.log(data);
                        //alert(JSON.stringify(data));return;
                        layer.close(index);
                        if(data.status==1){
                            $(obj).attr('flag',parseInt($(obj).attr('flag'))+1);
                            var str='';
                            clas++;
                            for(var i=0;i<data.msg.length;i++){
                                var clas1='label-warning';
                                var clas2='fa-child';
                                var btn='';
                                if(data.msg[i].hasChild==1){
                                    clas1='label-info';
                                    clas2='fa-users';
                                    btn='<span class="pull-right" onclick="getTree(this,'+data.msg[i].user_id+','+clas+')" flag="1"> + </span>';
                                }
                                str+='<li class="dd-item" data-id="8">'+
                                    '<div class="dd-handle">'+btn+
                                        '<span class="label '+clas1+'"><i class="fa '+clas2+'"></i></span> MT4 : '+data.msg[i].user_id+' Position : '+data.msg[i].user_position+' Class : '+clas+
                                    '</div>'+
                                '</li>';
                            }
                            $(obj).parent().parent().append('<ol class="dd-list">'+str+'</ol>');
                            $(obj).text('-');
                        }else{
                            layer.msg(data.msg,{icon: 2, time: 2000});
                        }
                    },error:function(err){
                        //console.log(err);
                        layer.close(index);
                        layer.msg('网络错误',{icon: 2, time: 2000});
                    }
                });
            }else if($(obj).attr('flag')==2){
                $(obj).parent('.dd-handle').nextAll('.dd-list').hide();
                $(obj).text('+');
                $(obj).attr('flag',3);
            }else{
                $(obj).parents('.dd-handle').nextAll('.dd-list').show();
                $(obj).text('-');
                $(obj).attr('flag',2);
            }
        }
    </script>
</body>
</html>
